/**
 * Sample React Native App
 * https://github.com/facebook/react-native
 * @flow
 */

import React, { Component } from 'react';
import {
    AppRegistry,
    StyleSheet,
    Text,
    View,
    TouchableHighlight,
    AlertIOS,
    NativeModules
} from 'react-native';






class CustomBtn extends React.Component {



    render() {
        return (
            <TouchableHighlight onPress={this.props.onPress}>
                <Text>原生与RN交互</Text>
            </TouchableHighlight>
        )
    }
}

export default class MyPage extends Component {
    render() {
        return (
            <View>
            
                <CustomBtn text='this is a button' onPress={this.clickOne} />
            </View>
        );
    }

    clickOne() {


        NativeModules.RNBridgeModule.showPackageName("dd");

       
    }
}